import { request } from '@umijs/max';

/** 获取用户信息 GET /user/list */
export async function getUserInfo() {
  return request<API.UserResponse>('/api/user/list', {
    method: 'GET',
  });
}

/** 保存用户信息 POST /user/save */
export async function saveUser(data: API.UserItem) {
  return request<API.Result>('/api/user/save', {
    method: 'POST',
    data,
  });
}

/** 用户登录 POST /user/login */
export async function login(data: { loginType: number; phone: string }) {
  return request<API.Result>('/api/user/login', {
    method: 'POST',
    data,
  });
}
